//
//  NvWindowPlayer.h
//  NvSellerShow
//
//  Created by bmd on 2017/3/27.
//  Copyright © 2017年 Meicam. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "NvsStreamingContext.h"
#import "NvsLiveWindow.h"
#import "MediaModel.h"
#import "Utils.h"
@class NvMakeFilmClipModel;
@class NvWindowPlayer;

@protocol NvWindowPlayerDelegate <NSObject>

- (void)nvWindowPlayer:(NvWindowPlayer *)player currentTimeString:(NSString *)currentTimeString totalTimeString:(NSString *)totalTimeString;

@end

@interface NvWindowPlayer : UIView
//实例化对象
+ (instancetype) instancePlayer;

@property (weak, nonatomic) id<NvWindowPlayerDelegate> delegate;

@property (strong, nonatomic) NvsStreamingContext *streamingContext;
@property (strong, nonatomic) NvsTimeline *timeline;
@property (strong, nonatomic) NvsVideoTrack *videoTrack;
@property (assign, nonatomic) NvSSVideoCreateScale createMode;

//if you want set you own timeline, you need set these values
@property (assign, nonatomic) int64_t playStart;
@property (assign, nonatomic) int64_t playEnd;

//需要播放的model
@property (nonatomic, strong) MediaModel *model;

//获取视频的时间(单位：微秒)
- (int64_t)duration;

//预览某一时间戳的图像
- (void)startSeekTimeline:(float)timestamp isLeft:(BOOL)isLeft;
//设置出入点
- (void)setTrimIn:(int64_t)trimIn trimOut:(int64_t)trimOut;
//在页面需要消失的时候需要clear一下清除资源
- (void)clear;

//if you want set you own timeline, you need invoke this
- (void)connectTimelineAndLiveWindow;
@end
